<template>
  <div>
    <!-- 传递固定contestId -->
    <ChildComponent :contest-id="1" />
    
    <!-- 动态绑定contestId（可通过按钮切换） -->
    <button @click="changeContestId">切换赛事</button>
    <ChildComponent :contest-id="currentContestId" />
  </div>
</template>

<script setup>
import { ref } from "vue";
import ChildComponent from "./testScore.vue"; // 子组件路径

const currentContestId = ref(1);

const changeContestId = () => {
  currentContestId.value = currentContestId.value === 1 ? 2 : 1;
  console.log(`父组件contestId变更为: ${currentContestId.value}`);
};
</script>